/**
 * 
 */
package cc.rico.activemq;

import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jms.core.JmsTemplate;

/**
 * @author rico 2016年8月14日
 *
 */
public class MessageProducer {
	private static final Logger logger = LoggerFactory.getLogger(MessageProducer.class);
	
	private JmsTemplate jmsTemplate;
	
	@Before
	public void init() {
		ApplicationContext context = new ClassPathXmlApplicationContext("cluster-producer.xml");
		jmsTemplate = (JmsTemplate) context.getBean("producerJmsTemplate");
	}
	
	@Test
	public void testSendMessage() {
		jmsTemplate.convertAndSend("message from MessageProducer");
	}
	
	
}
